// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file nsIHttpActivityObserver.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    /// nsIHttpActivityObserver
    ///
    /// This interface provides a way for http activities to be reported
    /// to observers.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("412880C8-6C36-48d8-BF8F-84F91F892503")]
	public interface nsIHttpActivityObserver
	{
		
		/// <summary>
        /// observe activity from the http transport
        ///
        /// @param aHttpChannel
        /// nsISupports interface for the the http channel that
        /// generated this activity
        /// @param aActivityType
        /// The value of this aActivityType will be one of
        /// ACTIVITY_TYPE_SOCKET_TRANSPORT or
        /// ACTIVITY_TYPE_HTTP_TRANSACTION
        /// @param aActivitySubtype
        /// The value of this aActivitySubtype, will be depend
        /// on the value of aActivityType. When aActivityType
        /// is ACTIVITY_TYPE_SOCKET_TRANSPORT
        /// aActivitySubtype will be one of the
        /// nsISocketTransport::STATUS_???? values defined in
        /// nsISocketTransport.idl
        /// OR when aActivityType
        /// is ACTIVITY_TYPE_HTTP_TRANSACTION
        /// aActivitySubtype will be one of the
        /// nsIHttpActivityObserver::ACTIVITY_SUBTYPE_???? values
        /// defined below
        /// @param aTimestamp
        /// microseconds past the epoch of Jan 1, 1970
        /// @param aExtraSizeData
        /// Any extra size data optionally available with
        /// this activity
        /// @param aExtraStringData
        /// Any extra string data optionally available with
        /// this activity
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void ObserveActivity([MarshalAs(UnmanagedType.Interface)] nsISupports aHttpChannel, uint aActivityType, uint aActivitySubtype, long aTimestamp, ulong aExtraSizeData, [MarshalAs(UnmanagedType.LPStruct)] nsACStringBase aExtraStringData);
		
		/// <summary>
        /// This attribute is true when this interface is active and should
        /// observe http activities. When false, observeActivity() should not
        /// be called. It is present for compatibility reasons and should be
        /// implemented only by nsHttpActivityDistributor.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetIsActiveAttribute();
	}
	
	/// <summary>nsIHttpActivityObserverConsts </summary>
	public class nsIHttpActivityObserverConsts
	{
		
		// 
		public const ulong ACTIVITY_TYPE_SOCKET_TRANSPORT = 0x0001;
		
		// 
		public const ulong ACTIVITY_TYPE_HTTP_TRANSACTION = 0x0002;
		
		// 
		public const ulong ACTIVITY_SUBTYPE_REQUEST_HEADER = 0x5001;
		
		// 
		public const ulong ACTIVITY_SUBTYPE_REQUEST_BODY_SENT = 0x5002;
		
		// 
		public const ulong ACTIVITY_SUBTYPE_RESPONSE_START = 0x5003;
		
		// 
		public const ulong ACTIVITY_SUBTYPE_RESPONSE_HEADER = 0x5004;
		
		// 
		public const ulong ACTIVITY_SUBTYPE_RESPONSE_COMPLETE = 0x5005;
		
		// 
		public const ulong ACTIVITY_SUBTYPE_TRANSACTION_CLOSE = 0x5006;
	}
	
	/// <summary>
    /// nsIHttpActivityDistributor
    ///
    /// This interface provides a way to register and unregister observers to the
    /// http activities.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("7C512CB8-582A-4625-B5B6-8639755271B5")]
	public interface nsIHttpActivityDistributor : nsIHttpActivityObserver
	{
		
		/// <summary>
        /// observe activity from the http transport
        ///
        /// @param aHttpChannel
        /// nsISupports interface for the the http channel that
        /// generated this activity
        /// @param aActivityType
        /// The value of this aActivityType will be one of
        /// ACTIVITY_TYPE_SOCKET_TRANSPORT or
        /// ACTIVITY_TYPE_HTTP_TRANSACTION
        /// @param aActivitySubtype
        /// The value of this aActivitySubtype, will be depend
        /// on the value of aActivityType. When aActivityType
        /// is ACTIVITY_TYPE_SOCKET_TRANSPORT
        /// aActivitySubtype will be one of the
        /// nsISocketTransport::STATUS_???? values defined in
        /// nsISocketTransport.idl
        /// OR when aActivityType
        /// is ACTIVITY_TYPE_HTTP_TRANSACTION
        /// aActivitySubtype will be one of the
        /// nsIHttpActivityObserver::ACTIVITY_SUBTYPE_???? values
        /// defined below
        /// @param aTimestamp
        /// microseconds past the epoch of Jan 1, 1970
        /// @param aExtraSizeData
        /// Any extra size data optionally available with
        /// this activity
        /// @param aExtraStringData
        /// Any extra string data optionally available with
        /// this activity
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new void ObserveActivity([MarshalAs(UnmanagedType.Interface)] nsISupports aHttpChannel, uint aActivityType, uint aActivitySubtype, long aTimestamp, ulong aExtraSizeData, [MarshalAs(UnmanagedType.LPStruct)] nsACStringBase aExtraStringData);
		
		/// <summary>
        /// This attribute is true when this interface is active and should
        /// observe http activities. When false, observeActivity() should not
        /// be called. It is present for compatibility reasons and should be
        /// implemented only by nsHttpActivityDistributor.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new bool GetIsActiveAttribute();
		
		/// <summary>
        /// nsIHttpActivityDistributor
        ///
        /// This interface provides a way to register and unregister observers to the
        /// http activities.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void AddObserver([MarshalAs(UnmanagedType.Interface)] nsIHttpActivityObserver aObserver);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void RemoveObserver([MarshalAs(UnmanagedType.Interface)] nsIHttpActivityObserver aObserver);
	}
}
